package com.bobohost.crmrbac.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.bobohost.crmrbac.dao.mapper.PermissionMapper;
import com.bobohost.crmrbac.pojo.po.Permission;
import com.bobohost.crmrbac.pojo.po.QueryObject;
import com.bobohost.crmrbac.service.PermissionService;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;


import java.util.List;

/**
 * @author jy
 * @version 1.0
 * @date 2022/2/10 18:23
 */
@Service
public class PermissionServiceImpl extends ServiceImpl<PermissionMapper, Permission> implements PermissionService {

    @Autowired
    private PermissionMapper permissionMapper;


    @Override
    public PageInfo<Permission> selectPermissionListPage(QueryObject queryObject) {

        PageHelper.startPage(queryObject.getCurrentPage(),queryObject.getPageSize());

        //查询列表
        List<Permission> permissionList = permissionMapper.selectList(null);

        return new PageInfo<Permission>(permissionList);
    }
}
